#pragma once
#ifndef __ECG_PROTOCOL_H__
#define __ECG_PROTOCOL_H__
#include <stdint.h>
typedef struct __ecg_protocol_data_len_wrong_t
{
    uint32_t receive_data_len; //!< 接收到的data_len
} ecg_protocol_data_len_wrong_t;
typedef struct __ecg_protocol_not_find_t
{
    uint32_t utc; //!< 接收到的时间
} ecg_protocol_not_find_t;
typedef struct __ecg_protocol_store_bad_t
{
    uint32_t store_result; //!< 存储设备返回的错误码
} ecg_protocol_store_bad_t;

typedef enum __ecg_protocol_result_t
{
    ecg_protocol_success = 0,
    ecg_protocol_data_len_wrong = -1,    //!< 传输的data区长度与预期不符
    ecg_protocol_not_find = -2,          //!< 找不到指定的数据
    ecg_protocol_store_bad = -3,         //!< 存储设备已损坏
    ecg_protocol_wrong_start_index = -4, //!< 指定的开始地址超过了文件大小
} ecg_protocol_result_t;

void ecg_history_protocol_decode(int cmd, const uint8_t *data, uint32_t data_len);

#endif //!<__ECG_PROTOCOL_H__
